#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int cmp(const void* a, const void* b)
{
    return strcmp(*(const char**)a, *(const char**)b);
}

int find_index(char** names, int n, char* s)
{
    int left = 0, right = n - 1;
    while (left <= right) {
        int mid = (left + right) / 2;
        int res = strcmp(names[mid], s);
        if (res == 0) return mid;
        if (res < 0) left = mid + 1;
        else right = mid - 1;
    }
    return -1;
}

int main()
{
    int n, m;
    scanf_s("%d %d", &n, &m);

    if (m == 0)
    {
        printf("None\n");
        return 0;
    }

    char** temp_strs = (char**)malloc(2 * m * sizeof(char*));
    for (int i = 0; i < 2 * m; i++) 
    {
        temp_strs[i] = (char*)malloc(11 * sizeof(char));
    }

    for (int i = 0; i < m; i++)
    {
        scanf_s("%s %s", temp_strs[2 * i], temp_strs[2 * i + 1]);
    }

    char** all_strs = (char**)malloc(2 * m * sizeof(char*));
    for (int i = 0; i < 2 * m; i++) 
    {
        all_strs[i] = temp_strs[i];
    }

    qsort(all_strs, 2 * m, sizeof(char*), cmp);

    char** names = (char**)malloc(n * sizeof(char*));
    int count = 0;
    for (int i = 0; i < 2 * m; i++)
    {
        if (i == 0 || strcmp(all_strs[i], all_strs[i - 1]) != 0) 
        {
            names[count++] = all_strs[i];
        }
    }

    int* deg = (int*)calloc(n, sizeof(int));
    for (int i = 0; i < m; i++)
    {
        int idx_a = find_index(names, n, temp_strs[2 * i]);
        int idx_b = find_index(names, n, temp_strs[2 * i + 1]);
        deg[idx_a]++;
        deg[idx_b]++;
    }

    long long* sum_deg = (long long*)calloc(n, sizeof(long long));
    for (int i = 0; i < m; i++)
    {
        int idx_a = find_index(names, n, temp_strs[2 * i]);
        int idx_b = find_index(names, n, temp_strs[2 * i + 1]);
        sum_deg[idx_a] += deg[idx_b];
        sum_deg[idx_b] += deg[idx_a];
    }

    int found = 0;
    for (int i = 0; i < n; i++) 
    {
        if (deg[i] > 0 && (long long)deg[i] * deg[i] > sum_deg[i])
        {
            found = 1;
            break;
        }
    }

    if (!found)
    {
        printf("None\n");
    }
    else {
        int first = 1;
        for (int i = 0; i < n; i++) 
        {
            if (deg[i] > 0 && (long long)deg[i] * deg[i] > sum_deg[i])
            {
                if (!first) 
                {
                    printf(" ");
                }
                printf("%s", names[i]);
                first = 0;
            }
        }
        printf("\n");
    }

    for (int i = 0; i < 2 * m; i++)
    {
        free(temp_strs[i]);
    }
    free(temp_strs);
    free(all_strs);
    free(names);
    free(deg);
    free(sum_deg);

    return 0;
}